﻿using System;
using System.Xml.Serialization;

namespace NerdWare.Crm2011VsTools.CrmScriptInjector.Configuration
{
    using System.ComponentModel;

    public class Config
    {
        public Config() { }

        [XmlIgnore]
        private Uri _crmServerUri;

        public Config(int fiddlerPort)
        {
            FiddlerPort = fiddlerPort;
        }

        [XmlIgnore]
        public Uri CrmServerUri
        {
            get
            {
                return _crmServerUri;
            }
        }

        public string CrmServerUrl
        {
            set
            {
                _crmServerUri = new Uri(value);
            }
            get
            {
                return _crmServerUri.ToString();
            }
        }

        public string OrganizationName { get; set; }

        public string ScriptPath { get; set; }

        [DefaultValue(8099)]
        public int FiddlerPort { get; set; }
    }
}
